package com.beamfield.dao.sys;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import com.beamfield.model.SystemDictionaryData;
import com.beamfield.model.SystemDictionaryDataExample;
import com.beamfield.modelVo.SystemDictionaryDataVo;

@Component
public interface SystemDictionaryDataMapper {
    int deleteByPrimaryKey(Long sys_dictionarydata_id);

    int insert(SystemDictionaryData record);

    int insertSelective(SystemDictionaryData record);

    List<SystemDictionaryData> selectByExample(SystemDictionaryDataExample example);

    SystemDictionaryData selectByPrimaryKey(Long sys_dictionarydata_id);

    int updateByPrimaryKeySelective(SystemDictionaryData record);

    int updateByPrimaryKey(SystemDictionaryData record);

    /**
     * 分页获取字典数据信息
     * @param startPage
     * @param rows
     * @param dic_name
     * @return
     */
    List<SystemDictionaryDataVo> getDictionaryDataList(
            @Param(value = "startPage") Integer startPage,
            @Param(value = "rows") Integer rows, @Param(value = "beam_id") Long beam_id,
            @Param("dicName") String dic_name, @Param("dicCode") String dicCode);

    /**
     * 获取字典数据统计
     * @return
     */
    long getDictionaryDataCount(@Param(value = "beam_id") Long beam_id, @Param("dicName") String dic_name, @Param("dicCode") String dicCode);

    /**
     * 根据编码获取数据字典
     * @param code
     * @return
     */
    List<SystemDictionaryDataVo> getDictionaryByCode(@Param(value="code")String code,@Param(value="beam_id")Long beam_id);



    SystemDictionaryData selectByCode(@Param(value="code")String code,@Param(value="beam_id")Long beam_id);

    SystemDictionaryData selectByName(@Param(value="name")String name,@Param(value="beam_id")Long beam_id);

    /**
     * 根据分类获取编码
     * @param sys_dictionary_id
     * @return
     */
    String getMaxDicCode(@Param(value="sys_dictionary_id")Long sys_dictionary_id,@Param(value="beam_id")Long beam_id);

    List<SystemDictionaryData> selectByCodeList(@Param("codeList") List<String> codeList,@Param("beam_id")Long beam_id);

    List<SystemDictionaryData> selectByFCodeList(@Param("codeList") List<String> strings,@Param("beam_id") long beam_id);

    List<SystemDictionaryData> getDictionaryByCodeAndValue(@Param("beamId")Long beamId,@Param("code")String code,@Param("value")String value);

    /**
     * 根据数据字典Id获取值
     * @param sys_dictionary_id
     * @param beamId
     * @return
     * @author anruoxin
     * 2019年4月22日
     */
	List<SystemDictionaryDataVo> getDictionaryBySystemDictionId(@Param(value="sys_dictionary_id")Long sys_dictionary_id, @Param(value="beam_id")Long beamId);

    List<SystemDictionaryData> selectPage(@Param("pcode") String pcode, @Param("offset") String offset, @Param("limit") String limit, @Param("beamId") Long beamId);

    long countPage(@Param("pcode") String pcode, @Param("beamId") Long beamId);
}
